/*
 * Copyright (c) 2023 iQi.Co.Ltd. All rights reserved.
 */
 
using IQIGame.Onigao.Framework;
using System.Collections.Generic;
using System.Linq;
using System;
using NetProtocol.Enum;

namespace NetProtocol.POD {

	/// <summary>
	///  level记录数据，系统层数据
	/// module : structs
	/// </summary>
	public class LevelRecordPOD : IPOD 
    {
        public readonly static Func<LevelRecordPOD> FACTORY = () => new LevelRecordPOD();
		public static Func<LevelRecordPOD> DynamicFactory = FACTORY;
        
		/*-- members --*/
		/// <summary>
        ///  唯一ID
        /// </summary>
		public long id;
		/// <summary>
        ///  配置id	
        /// </summary>
		public int cid;
		
		
		
		/*-- constructors --*/
		public LevelRecordPOD() {}
		public LevelRecordPOD(long id, int cid) {
			this.id = id;
			this.cid = cid;
		}
	      public void Serial(SOutputStream _out) {
            _out.Write_long(id);
            _out.Write_int(cid);
        }
        
        public void UnSerial(SInputStream _in) {
            if(!_in.HasRemaining()) return;
            id = _in.Read_long();
            if(!_in.HasRemaining()) return;
            cid = _in.Read_int();
        }
		
		public LevelRecordPOD Clone() {
            LevelRecordPOD o = DynamicFactory();
            o.id = id;
            o.cid = cid;
            return o;
        }
        
        public void Clear() {
            id = default;
            cid = default;
        }
		
        public override string ToString() {
			string str = "";
			str += "LevelRecordPOD [";
			str += "id=";
			str += id;
			str += ", cid=";
			str += cid;
			str += "]";
			return str;
		}
		
	}
}